package com.hongtech.modules.app.controller;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.hongtech.common.bean.AjaxResultVo;
import com.hongtech.modules.knowledge.dto.BannerDTO;
import com.hongtech.modules.system.dto.RegionDTO;
import com.hongtech.modules.system.service.RegionService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * APP测试接口
 */
@RestController
@RequestMapping("/app")
@Api("APP公共接口")
public class AppCommonController {

    @Autowired
    private RegionService regionService;

    @RequestMapping("/provinceList")
    @ApiOperation("省份列表")
    public AjaxResultVo provinceList() {
        List<RegionDTO> list = regionService.provinceList();
        return AjaxResultVo.success(list);
    }

    @RequestMapping("/cityList")
    @ApiOperation("城市列表")
    public AjaxResultVo cityList(String provinceId) {
        List<RegionDTO> list = regionService.cityListByProvinceId(provinceId);
        return AjaxResultVo.success(list);
    }

}
